 package com.jtpay.sth0409.patternlockdemo;


import android.os.Bundle;


import com.jtpay.sth0409.patternlockdemo.Util.AppUtil;
import com.jtpay.sth0409.patternlockdemo.Util.ContentUtil;
import com.jtpay.sth0409.patternlockdemo.Util.SPUtils;
import com.jtpay.sth0409.patternlockdemo.Util.ThemeUtils;

import java.util.List;

import me.zhanghai.android.patternlock.PatternUtils;
import me.zhanghai.android.patternlock.PatternView;
import me.zhanghai.android.patternlock.SetPatternActivity;

 /**
  * 设置手势密码界面
  */
 public class SampleSetPatternActivity extends SetPatternActivity {


     @Override
     protected void onCanceled() {
        // super.onCanceled();
         AppUtil.getInstance(this).finishAllAC();
     }

     @Override
    protected void onCreate(Bundle savedInstanceState) {
        ThemeUtils.applyTheme(this);
        super.onCreate(savedInstanceState);
    }

     @Override
     protected void onSetPattern(List<PatternView.Cell> pattern) {
         String patternSha1 = PatternUtils.patternToSha1String(pattern);
         // TODO: Save patternSha1 in SharedPreferences.
        SPUtils.getInstance(this).setPattern(ContentUtil.KEY,patternSha1);
     }

}
